package com.sgb.goods.viewmodel;

import androidx.lifecycle.MutableLiveData;

import com.sgb.goods.api.GoodsCallBack;
import com.sgb.goods.api.GoodsNet;
import com.sgb.goods.entity.GetSkuEntity1;
import com.sgb.goods.utils.base.viewmodel.BaseViewModel;
import com.swgk.core.base.model.entity.BaseEntity;

import java.util.List;

public class GoodsSpecViewModel extends BaseViewModel {

    public MutableLiveData<List<GetSkuEntity1>> skuListLD = new MutableLiveData<>();

    /** 获取是否可以填写规格 */
    public void getSku(String cid3) {
        showLoading();
        GoodsNet.getInstance().getGoodsPublishApi().getSku(Long.parseLong(cid3)).enqueue(
                new GoodsCallBack<BaseEntity<List<GetSkuEntity1>>>() {
            @Override
            public void onSuccess(BaseEntity<List<GetSkuEntity1>> data) {
                skuListLD.setValue(data.getData());
            }
        });
    }

}
